<?
session_start();
if(!session_is_registered("myusername")){
    header("location:index.php");
}
else{
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
        <title>Kartapuce - Projet BDD FPMs >> Aide</title>
        <link rel="stylesheet" href="./mystyle.css" type="text/css" media="screen" />
    </head>
    <body>
        <small>
            <b>Logged as:
                <?
                session_start();
                print $myusername;
                ?>
                <A HREF="./logout.php">Log out</A>

            </b>
        </small>

        <div id="conteneur" align="center" class="conteneur">
            <div align="center" class="conteneurdessus">
                <img src="img/banner.png" width="600" height="185" alt="banner" border="0"/>
            </div>
        </div>
        <center>
            <div id="conteneurdessus" align="center" class="conteneurdessus">
                <table border="0" cellspacing="10">
                    <td>
                        <A HREF="./boutique.php"><img src="img/boutique.png" width="138" height="39" alt="boutique" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./compte.php"><img src="img/compte.png" width="138" height="39" alt="compte" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./commandes.php"><img src="img/commandes.png" width="138" height="39" alt="commandes" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./panier.php"><img src="img/panier.png" width="138" height="39" alt="panier" border="0"/>
                        </A>
                    </td>
                    <td>
                        <A HREF="./accueil.php"><img src="img/accueil.png" width="138" height="39" alt="accueil" border="0"/>
                        </A>
                    </td>
                </table>

            </div>
            <div id='colonne1' align='left' class='colonnem'>
            <?
            include 'connect_db.php';

            $sql="SELECT * FROM db_cartes WHERE ProduitFini=TRUE";
            $result=mysql_query($sql);

            echo "<form name=form2 method=post action=add2cart.php>";

            echo '<TABLE BORDER=1>';
            echo '<TR><TD><b>IDcarte</b></TD><TD><b>Prix(EUR)</b></TD><TD><b>Description</b></TD><TD><b>Quantité désirée</b></TD><TD><b>Détails</b></TD></TR>';
            while($tableau=mysql_fetch_array($result,MYSQL_ASSOC)){
                echo '<TR><TD>',$tableau['idcarte'],'</TD><TD>',$tableau['prix_indique'],'</TD><TD>',$tableau['description'],'</TD><TD>','<input type="text" name="qtytxt',$tableau['idcarte'],'" value="0" />','</TD><TD><input type="button" value="Détails carte" OnClick=window.open("details_cartes.php?id='.$tableau['idcarte'].'")></TD></TR>';

            }

            echo '</TABLE>';
            echo '<input type="submit" name="Submit" value="Ajouter au panier">';
            echo "</form>";

            mysql_close($link);

            ?>
            </div>
        </center>
    </body>
</html>